unit USingleton;

interface

type
  TMyUniqueClass = class
    private
      FValue: Extended;
      procedure SetValue(const Value: Extended);
      property Value: Extended read FValue write SetValue;
    protected
      constructor Create;
    public
  end;

  TMyClass = class
    private
      procedure SetUniqueValue(const Value: Extended);
      function GetUniqueValue: Extended;
      property UniqueValue: Extended read GetUniqueValue write SetUniqueValue;
    protected
    public
  end;

  var
    MyUniqueClass: TMyUniqueClass;

implementation

{ TMyClass }

function TMyClass.GetUniqueValue: Extended;
begin
  Result := MyUniqueClass.Value;
end;

procedure TMyClass.SetUniqueValue(const Value: Extended);
begin
  MyUniqueClass.Value := Value;
end;

{ TMyUniqueClass }

constructor TMyUniqueClass.Create;
begin
  inherited;
end;

procedure TMyUniqueClass.SetValue(const Value: Extended);
begin
  FValue := Value;
end;

initialization
  MyUniqueClass := TMyUniqueClass.Create;

finalization
  MyUniqueClass.Free;
  
end.
 